﻿namespace AgentJohnson.Shell
{
  using AgentJohnson.Generators;
  using AgentJohnson.SmartGenerators;
  using AgentJohnson.SmartGenerators.Scopes;
  using JetBrains.Application;
  using Resharper.Abstractions.Generators;
  using Resharper.Abstractions.Shell;

  /// <summary>Defines the <see cref="Loader"/> class.</summary>
  [ShellComponent]
  public class Loader
  {
    #region Constructors and Destructors

    /// <summary>Initializes a new instance of the <see cref="Loader"/> class.</summary>
    public Loader()
    {
      var shellManager = new ShellManager();
      shellManager.Init();

      GeneratorManager.Register(new SmartGeneratorPopulator());
      GeneratorManager.Register(new IteratorPopulator());
      GeneratorManager.Register(new AssignmentPopulator());
      GeneratorManager.Register(new FlowControlPopulator());
      GeneratorManager.Register(new ReturnPopulator());

      ScopeManager.Register(new EndOfBlockScope());
      ScopeManager.Register(new ClassMemberScope());
      ScopeManager.Register(new TypeScope());
      ScopeManager.Register(new SwitchCaseScope());
      ScopeManager.Register(new AfterInvocationScope());
      ScopeManager.Register(new BeforeInvocationScope());
      ScopeManager.Register(new AfterLocalVariableDeclarationScope());
      ScopeManager.Register(new BeforeLocalVariableDeclarationScope());
      ScopeManager.Register(new InterfaceMemberScope());
      ScopeManager.Register(new StructMemberScope());
      ScopeManager.Register(new EmptyFileScope());
      ScopeManager.Register(new AfterEnumerableScope());
    }

    #endregion
  }
}